
const libName = 'muse';     //导入的库名称
const desc = 'muse3.0.2';   //导入的库说明
const dependencies = [      //依赖
    '/${workspaceFolder}/node_modules/muse-ui/dist/muse-ui.js',
    '/${workspaceFolder}/node_modules/muse-ui/dist/muse-ui.css',
    //https://cdn.bootcss.com/material-design-icons/3.0.1/iconfont/material-icons.css实在太慢,所以将资源下载到本地依赖
    '/${workspaceFolder}/src/assets/material-icons.css'];


/**
 * 用于在控件选择区生成可拖拽的图标
 */
const controlMetas = {
    'muse':{              //可选控件的category id
        label:'muse',     //控件的category name
        constructionalElements:[    //category下的所有控件
            {
                icon:'<div>appbar</div>',     //控件图标可为svg,html(比如base64图片)或字符串
                label:'appbar',               //控件图标下的文字
                title:'工具条',               //鼠标在控件图标上悬停后出现的注释
                style:{                       //控件图标和文字内联样式

                },
                dragDropConfig: {            //图标的拖拽控制
                    //同createdInstance中的dragDropConfig
                },
                createdInstance:{                               //图标拖拽到设计视图内部成为页面组件实例后的初始化配置
                    tag: 'mu-appbar',                           //标签名称
                    initProps: {color: 'primary'},              //初始属性
                    otherConfig:{
                        isRefreshRoot:false,                    //boolean,渲染时是否在外面加一个div,用来加快渲染速度,默认(不设置)是true
                        //style                                 //初始化style
                        //innerTemplate                         //boolean,是否有innerTemplate属性,或者innerTemplate属性的初始化值
                        slots:true,                             //是否有slot属性,已经slot属性的初始值
                        //structure                             //是否有structure属性或者structure属性的初始值
                        //scopedSlots                           //是否有作用域插槽,以及作用域插槽的初始值
                    },
                    dragDropConfig: {
                        isComponent: true,                      //true自定义组件,false为html标签
                        //needInput                             //boolean 针对某些input组件无法拖拽
                        //toDragGroupName                       //string或[String] 规定了其可以被拖拽到什么位置(和drag target的beDragGroupName匹配),默认为"dev"
                        //beDragGroupName                       //string或[String] 规定了什么组件可以被拖拽过来(和drag source的toDragGroupName匹配),默认为"dev"
                        //dropTargetFlag                        //number或[number] 1.可以将其他组件拖拽到内部 2.其他组件可以拖拽到旁边 3.(1||2)任意,这个属性用来进一步约束beDragGroupName
                    }
                }
            },
            {
                icon:'<img style="width:35px;height:25px;" src=""/>',
                label:'button',
                title:'按钮',
                createdInstance:{
                    tag: 'mu-button',
                    initProps: {color: 'success'},
                    //必须有这个属性
                    otherConfig:{
                        isRefreshRoot:false, 
                        innerTemplate: true,
                    },
                    dragDropConfig: {
                        //是自定义组件,而不是html标签
                        isComponent: true,
                        //当作为dragTarget时只能做兄弟节点
                        dropTargetFlag: 2
                    }
                }
            }
        ]
    }
};


const options = {
    'mu-appbar':[
        {
            "name": "color",
            "desc": "组件的颜色",
            "types": ["string"],
            "default": 'primary',
        },
        {
            "name": "textColor",
            "desc": "文本的颜色",
            "types": ["string"],
            "default": null,
        },
        {
            "name": "title",
            "desc": "组件的标题，定义了 default slot",
            "types": ["string"],
            "default": null,
        },
        {
            "name": "z-depth",
            "desc": "阴影深度",
            "types": ["number"],
            "default": null,
        },
    ],
    'mu-button':[
        {
            "name": "color",
            "desc": "按钮的颜色",
            "types": ["string"],
            "options":['primary','secondary','success','warning','info','error'],
            "default": 'success',
        },
        {
            "name": "textColor",
            "desc": "文本的颜色",
            "types": ["string"],
            "default": null,
        },
        {
            "name": "ripple",
            "desc": "是否有波纹效果",
            "types": ["boolean"],
            "default": true,
        },
        {
            "name": "fab",
            "desc": "浮动按钮",
            "types": ["boolean"],
            "default": false,
        },
        {
            "name": "flat",
            "desc": "扁平按钮",
            "types": ["boolean"],
            "default": false,
        },
        {
            "name": "icon",
            "desc": "图标按钮",
            "types": ["boolean"],
            "default": false,
        },
    ]
};